/**公共api */
import request from './request.js';
let service = request.service;
let formatterUrl = request.formatterUrl;
export default {
  /**获取码表
   * type - invoiceType 发票类型 type - paymentMethod 付款方式
   * type - transporttationMethod 送货方式
   * */
  getCodeList(type) {
    return service({
      url: `/adscm/system/code/queryCoedByType/${type}`,
      method: 'get'
    })
  },
  imgUpload() {
    /**图片上传 */
    return formatterUrl({
      url: '/adscm/operation/filesystem/upload'
    })
  },
  /**根据用户tokenId获取用户菜单 */
  getMenuByUser() {
    return service({
      url: `/adscm/system/menu/getUsersSrc`,
      method: 'get'
    })
  },
  /**根据当前菜单id下当前用户的权限操作*/
  getMenuJurisdiction(menuId) {
    return service({
      url: `/adscm/system/menu/getMenuAllSrc/${menuId}`,
      method: 'get'
    })
  },
  //获取任务执行部门列表
  selectDepts() {
    return service({
      url: `/adscm/operation/taskManager/selectDepts`,
      method: 'get'
    })
  },
   //根据部门id，获取任务执行人列表
  taskPerformPerson(id) {
    return service({
      url: `/adscm/operation/taskManager/selectTaskPerformPerson/${id}`,
      method: 'get'
    })
   },
   /**获取所有用户列表 */
  getAllUsers() {
    return service({
      url: `/adscm/system/user/selectAllUser`,
      method: 'get'
    })
  },
  taskManagerAttchmentDownload(id) { //原文献下载
    return download({
      url: `/adscm/operation/taskManagerAttchment/download/${id}`
    })
  },
  /**上传使用说明url */
  uploadInstructionsUrl(mid) {
       return formatterUrl({
         url: `/adscm/operation/jySoftDescription/upload/${mid}`
       })
     },
  /**预览使用说明url */
  viewInstructionsUrl(mid) {
    return formatterUrl({
      url: `/adscm/operation/jySoftDescription/view/${mid}`
    })
  },
  /**下载使用说明url */
  downloadInstructionsUrl(mid) {
    return formatterUrl({
      url: `/adscm/operation/jySoftDescription/downloadPdf/${mid}`
    })
  },
  /**获取所有采购人员列表*/
  getAllCgPersons() {
    return service({
      url: `/adscm/operation/cg/cgTask/selectCgPersons`,
      method: 'get',
    })
  },
  /**图片上传 公共接口*/
   publicImgLoad() {
     return formatterUrl({
       url: '/adscm/operation/upload'
     })
   },
  //  获取基本档案信息
   getArchivalInfo(providerId) {
     return service({
       url: `/adscm/application/providerInfo/selectByProviderId/${providerId}`,
       method: 'get',
     })
   }
}